Skip to main content

All Questions

1vote
1answer
44views

Page download with reattempts in Scala

I wrote the following code to deal with possible network problems. ...
Alex Stamper's user avatar
0votes
1answer
79views

Report a status based on a list of results

In one of my services, I have the function as presented below: ...
Alex A.'s user avatar
1vote
1answer
150views

Parsing latitude and longitude, using Try[T] to ignore errors

I wrote this question asking about how to implement my error handling while still maintaining functional code and based on 200_success's very interesting note on the spaces, I decided to ...
Rodrigo Sasaki's user avatar
1vote
1answer
220views

Implementation of API to create a company account in a database

I'm working on an API that has a lot of controller functions like this: ...
TylerAndFriends's user avatar
2votes
1answer
51views

Pushing data to an analytics API

This is code that handles pushing data to an analytics API, and IMO it feels too much like Java. logActivity is a method that uses ...
Aslan Varoqua's user avatar
2votes
1answer
98views

Print Trace Debugger

Notice: The original library has since been replaced by: https://github.com/JohnReedLOL/scala-trace-debug See my Scala print trace debugger. This project is used for lightweight debugging sort of ...
Michael Lafayette's user avatar
3votes
1answer
2kviews

Playframework (Scala) custom exception handling

I am using play framework with scala and here is a scenario on which I would like to have your opinion. Let's say I have 2 ...
lovesh's user avatar
3votes
2answers
285views

Exception handling for timing CouchBase fetch

...
Jas's user avatar
  • 173
2votes
2answers
2kviews

Branching with multiple Try

I have a series of four method calls that all return Try[Something], with the last returning Try[Unit]. Something like this: ...
Joe K's user avatar
8votes
2answers
906views

Idiomatic Scala try option code block

Basically, this function returns a list of flights for an airline. But if the airline doesn't exist, I want to throw some custom runtime exception. If that airline does exist, I want to return a list ...
smk's user avatar
  • 371
3votes
2answers
348views

Adding two values in a map, if they exist

My code looks like imperative style code. I want to make my code more functional. How I can rewrite my program so it become functional style code? ...
MyTitle's user avatar
7votes
2answers
7kviews

Handling parsing failure in Scala without exceptions

I have a Scala (Play!) application that must get and parse some data in JSON from an external service. I want to be able to gently handle failure in the response format, but it is becoming messy. What ...
Andrea's user avatar
6votes
3answers
3kviews

A safer way to cut a string

I want to get just the first line of a big string. Currently, here's how I do it: ...
bertzzie's user avatar

close